<!--
 * @Description  : 
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2022-05-06 11:15:05
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-05-06 15:28:50
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\vehicle\\components\\list\\list.component.html
 * Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<!-- <page-header-wrapper></page-header-wrapper>
<nz-card>
  <div nz-row nzGutter="8">
    <div nz-col [nzSpan]="_$expand ? 24 : 18">
      <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
    </div>
    <div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right">
      <button nz-button nzType="primary" acl [acl-ability]="['VEHICLE-LIST-search']" [nzLoading]="service.http.loading"
        (click)="st?.load(1)">查询</button>
      <button nz-button nzType="primary" [disabled]="false" (click)="exportFire()" acl
        [acl-ability]="'VEHICLE-LIST-export'">导出</button>
      <button nz-button [disabled]="false" (click)="resetSF()">重置</button>
      <button nz-button nzType="link" (click)="expandToggle()">
        {{ !_$expand ? '展开' : '收起' }}
        <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
      </button>
    </div>
  </div>
</nz-card> -->
<nz-card class="table-box">
  <div class="header_box">
    <label class="page_title"> <label class="driver">|</label> 车辆列表</label>
    <div class="mr-sm">
      <button nz-button nzDanger [nzLoading]="service.http.loading" (click)="openDrawer()" acl [acl-ability]="['VEHICLE-LIST-search']"
        >筛选</button
      >
      <button nz-button nzDanger (click)="exportFire()" acl [acl-ability]="'VEHICLE-LIST-export'"> 导出</button>
    </div>
  </div>

  <!-- 数据列表 -->
  <st
    #st
    [bordered]="true"
    [scroll]="{ x: '1200px', y: scrollY }"
    [columns]="columns"
    [data]="service.$api_get_operate_list"
    [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
    [res]="{ reName: { list: 'data.records', total: 'data.total' }, process: dataProcess }"
    [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
    [loading]="false"
  >
    <ng-template st-row="carLength" let-item let-index="index">
      <div
        >{{ item?.carModel ? item?.carModel + '-' : '' }}{{ item?.carLengthLabel ? item?.carLengthLabel + '米' : '' }}-{{
          item?.carLoad ? item?.carLoad + '吨' : ''
        }}</div
      >
    </ng-template>
    <ng-template st-row="isSelf" let-item let-index="index">
      <div>
        {{ item?.isSelf ? '是' : '否' }}
      </div>
    </ng-template>
    <ng-template st-row="putOnRecord" let-item let-index="index">
      <div>
        {{ item?.putOnRecord ? '是' : '否' }}
      </div>
    </ng-template>
    <ng-template st-row="approvalAuditStatus" let-item let-index="index">
      <div>
        <span *ngIf="item?.approvalAuditStatus === -1 || (item?.approvalAuditStatus === '-1' && item?.isSelf)">未上传</span>
        <span *ngIf="item?.approvalAuditStatus === 0 || (item?.approvalAuditStatus === '0' && item?.isSelf)">草稿</span>
        <span *ngIf="item?.approvalAuditStatus === 10 || (item?.approvalAuditStatus === '10' && item?.isSelf)">待审核</span>
        <span *ngIf="item?.approvalAuditStatus === 15 || (item?.approvalAuditStatus === '15' && item?.isSelf)">已撤销</span>
        <span *ngIf="item?.approvalAuditStatus === 20 || (item?.approvalAuditStatus === '20' && item?.isSelf)">已审核</span>
        <span *ngIf="item?.approvalAuditStatus === 30 || (item?.approvalAuditStatus === '30' && item?.isSelf)">已驳回</span>
        <span *ngIf="item?.approvalAuditStatus === 40 || (item?.approvalAuditStatus === '40' && item?.isSelf)">证件过期</span>
        <span *ngIf="!item?.isSelf">-</span>
      </div>
    </ng-template>
    <ng-template st-row="stateCol" let-item let-index="index">
      <nz-tag *ngIf="item.stateLocked" nzColor="error">冻结</nz-tag>
      <nz-tag *elseBlock nzColor="success">正常</nz-tag>
    </ng-template>
  </st>
</nz-card>
